package com.tywj.buscustomerapp.view.fragment;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.squareup.leakcanary.RefWatcher;
import com.tywj.buscustomerapp.App;

import butterknife.ButterKnife;
import butterknife.Unbinder;

public abstract class BaseFragment extends Fragment {
    private View view;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(setContentView(), container, false);
        isCanLoadData();
        ititClick();
        return view;
    }

    protected abstract void ititClick();
    protected abstract int setContentView();
    protected View getContentView() {
        return view;
    }

    protected <T extends View> T findViewById(int id) {
        return (T) getContentView().findViewById(id);
    }

    protected abstract void lazyLoad();
    private void isCanLoadData() {
        lazyLoad();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }
}
